//index.js
//获取应用实例
const app = getApp()
const Pager = require('components/aotoo/core')
const util = require('../../utils/util.js')

const mkPoster = require('components/modules/poster')
const defaultAdapter = require('../../utils/default')

const xx = defaultAdapter({title: '提交成功', desc: '发票开具中，请耐心等候', image: '/images/cat.png', cancel: true, cancelText: '返回首页', onCancel: 'onJump', confirm: true,})
const xx2 = defaultAdapter({title: '找不到此产品', image: '/images/cat.png', cancel: true, cancelText: '返回首页', onCancel: 'onJump'})
const xx3 = defaultAdapter({title: '网络错误', image: '/images/cat.png', cancel: true, cancelText: '返回首页', confirm: true, onCancel: 'onJump'})

Pager({
  data: {
    pages: {
      id: 'actionSide1'
    }
  },
  onJump(e, params, inst) {
    wx.navigateBack()
  },
  poster() {
    return {
      '@list': mkPoster({
        isImg: false,
        data: [xx, xx2, xx3],
        footer: false,
        itemClass: 'item-default poster-item',
        type: {
          current: 0,
          'previous-margin': '80rpx',
          'next-margin': '80rpx'
        },
      }),
      type: 'noAnmate',
      itemClass: 'swiper-poster'
    }
  },
  onShow: function () {},
  onReady: function () {
    const aside1 = this.getElementsById('actionSide1')
    console.log(aside1)
    aside1.reset().poster(this.poster())
    util.insertScreenAD('adunit-1aaa4a38a649de35')
  },
  onLoad: function () {},
})
